let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start"),
                    Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.TimeMrg = void 0);
                var n = t('TimeFrame'),
                    i = t('Timer'),
                    r = t('GlobalEventMrg'),
                    a = (function() {
                        function t() {}
                        return (
                            Object.defineProperty(t, 'delayTime', {
                                get: function get() {
                                    return t._delayTime;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(t, 'serverTime', {
                                get: function get() {
                                    var t = Date.now();
                                    return this._severTime ?
                                        this._severTime + (t - this._upServerTime) :
                                        t;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(t, 'timer', {
                                get: function get() {
                                    return t._timer;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (t.createFrame = function() {
                                var e = new n.TimeFrame();
                                return t._addTimeFrames.push(e), e;
                            }),
                            (t.recycleFrame = function(e) {
                                e.stop(), t._removeTimeFrames.push(e);
                            }),
                            (t._addTimeFrame = function() {
                                var e = t._addTimeFrames.length;
                                if (e > 0) {
                                    for (var o = 0; o < e; o++) {
                                        var n = t._addTimeFrames[o];
                                        t._timeFrames.push(n);
                                    }
                                    t._addTimeFrames.splice(0, e);
                                }
                            }),
                            (t._removeTimeFrame = function() {
                                if (t._removeTimeFrames.length > 0) {
                                    for (var e = 0; e < t._removeTimeFrames.length; e++) {
                                        var o = t._removeTimeFrames[e],
                                            n = this._findTimeFrame(o);
                                        n > -1 && t._timeFrames.splice(n, 1), o.destroy();
                                    }
                                    t._removeTimeFrames = [];
                                }
                            }),
                            (t._findTimeFrame = function(e) {
                                if (e)
                                    for (var o = 0; o < t._timeFrames.length; o++) {
                                        var n = t._timeFrames[o];
                                        if (e.objId == n.objId) return o;
                                    }
                                return -1;
                            }),
                            (t.update = function(e) {
                                (t._delayTime = e),
                                t._removeTimeFrame(),
                                    t._addTimeFrame(),
                                    t._timer.update(e);
                                for (var o = 0; o < t._timeFrames.length; o++) {
                                    t._timeFrames[o].update(e);
                                }
                                t.checkNewDay() && r.default.emit(r.GlobalEvent.NewDay);
                            }),
                            (t.upServerTime = function(e) {
                                (t._upServerTime = Date.now()),
                                (t._severTime = e),
                                (t._serverDate = new Date(e)),
                                (t._checkNewDayTime = t.serverTime + t.CHECKDAYTIME);
                            }),
                            (t.checkNewDay = function() {
                                if (t._serverDate) {
                                    var e = t.serverTime;
                                    if (e >= t._checkNewDayTime) {
                                        var o = new Date(e);
                                        if (
                                            ((t._checkNewDayTime = e + t.CHECKDAYTIME),
                                                o.getDate() > t._serverDate.getDate() ||
                                                o.getMonth() > t._serverDate.getMonth() ||
                                                o.getFullYear() > t._serverDate.getFullYear())
                                        )
                                            return this.upServerTime(e), !0;
                                    }
                                }
                                return !1;
                            }),
                            (t.CHECKDAYTIME = 2),
                            (t._delayTime = 0),
                            (t._timeFrames = []),
                            (t._addTimeFrames = []),
                            (t._removeTimeFrames = []),
                            (t._timer = new i.Timer()),
                            t
                        );
                    })();
                (o.TimeMrg = a), console.log("end");
            module.exports =  e.exports;